/**
 * Created by windo on 2016/11/22.
 */
/*var a="a"
let b= "b";
console.log(a)*/
for (var i = 0 ;i<3;i++)
{
    var b=1;            //外部也可以访问 等同window.b
  /*  setTimeout(function () {
        console.log(i)
    },1000)*/
    //闭包的写法
    ;(function (i) {
        setTimeout(function () {
            console.log(i)
        },1000)
    })(i);
}
for (let i = 0 ;i<3;i++)
{
    var b=1;            //外部也可以访问 等同window.b
    setTimeout(function () {
     console.log(i)
     },1000)
}


